﻿<%@ Page Title="アドレス帳" Language="C#" Inherits="System.Web.Mvc.ViewPage<MvcWebRole1.Models.AddressBookIndexModel>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>アドレス帳</title>
</head>
<body>
	<p>アドレス帳の閲覧</p>
	<p><%: Model.TotalCount %> 件が登録されています。</p>
	
	<%: Html.ActionLink("追加","AddAddr") %>
	<hr />
	<% foreach (var addressBookEntity in Model.AddressList)
	{ %>
		<%: addressBookEntity.BookedUser %> 
		<%: Html.ActionLink("削除", "DeleteAddr", new { bookedUser = addressBookEntity.BookedUser })%>
		<%: Html.ActionLink("タグを追加", "TagAddr", new { bookedUser = addressBookEntity.BookedUser })%>
		<% foreach (var tag in addressBookEntity.TagList.Split(';'))
		{%>
			<%: tag %> <%: Html.ActionLink("タグを削除","UnTagAddr", new {bookedUser=addressBookEntity.BookedUser, tag=tag } ) %>
		<% } %>
		<hr />
	<% } %>

	<% if( Model.CurrentPage!=Model.MaxPage ) {%>
	<%: Html.ActionLink("次ページ", "AddrBook", new { page=Model.CurrentPage+1 }) %>
	<% } %>
	<% if( Model.CurrentPage!=1 ) {%>
	<%: Html.ActionLink("前ページ", "AddrBook", new { page=Model.CurrentPage-1 }) %>
	<% } %>

</body>
</html>